using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._CartographyTools._MapSeries
{
    /// <summary>
    /// <para>Calculate Grid Convergence Angle</para>
    /// <para>Calculates the rotation angle for true north based on the center point of each feature in a feature class and populates this value in a specified field. This field can be used in conjunction with a spatial map series to rotate each map to true north.</para>
    /// <para>根据要素类中每个要素的中心点计算正北的旋转角度，并将此值填充到指定字段中。此字段可与空间地图系列结合使用，以将每张地图旋转到正北。</para>
    /// </summary>    
    [DisplayName("Calculate Grid Convergence Angle")]
    public class CalculateGridConvergenceAngle : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CalculateGridConvergenceAngle()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The input feature class (points, multipoints, lines, and polygons).</para>
        /// <para>输入要素类（点、多点、线和面）。</para>
        /// </param>
        /// <param name="_angle_field">
        /// <para>Angle Field</para>
        /// <para>The existing field that will be populated with the true north calculation value in decimal degrees.</para>
        /// <para>将使用以十进制度为单位的真北计算值填充的现有字段。</para>
        /// </param>
        public CalculateGridConvergenceAngle(object _in_features, object _angle_field)
        {
            this._in_features = _in_features;
            this._angle_field = _angle_field;
        }
        public override string ToolboxName => "Cartography Tools";

        public override string ToolName => "Calculate Grid Convergence Angle";

        public override string CallName => "cartography.CalculateGridConvergenceAngle";

        public override List<string> AcceptEnvironments => ["cartographicCoordinateSystem", "workspace"];

        public override object[] ParameterInfo => [_in_features, _angle_field, _rotation_method.GetGPValue(), _coordinate_sys_field, _out_features];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The input feature class (points, multipoints, lines, and polygons).</para>
        /// <para>输入要素类（点、多点、线和面）。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Angle Field</para>
        /// <para>The existing field that will be populated with the true north calculation value in decimal degrees.</para>
        /// <para>将使用以十进制度为单位的真北计算值填充的现有字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Angle Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _angle_field { get; set; }


        /// <summary>
        /// <para>Rotation Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the method used to calculate the rotation value.</para>
        ///   <bulletList>
        ///     <bullet_item>Geographic—The angle is calculated clockwise with 0 at the top. This is the default.</bullet_item><para/>
        ///     <bullet_item>Arithmetic—The angle is calculated counterclockwise with 0 at the right.</bullet_item><para/>
        ///     <bullet_item>Graphic—The angle is calculated counterclockwise with 0 at the top.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定用于计算旋转值的方法。</para>
        ///   <bulletList>
        ///     <bullet_item>地理 - 角度按顺时针方向计算，顶部为 0。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>算术 - 角度按逆时针方向计算，右侧为 0。</bullet_item><para/>
        ///     <bullet_item>图形 - 角度按逆时针方向计算，顶部为 0。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Rotation Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _rotation_method_value _rotation_method { get; set; } = _rotation_method_value._GEOGRAPHIC;

        public enum _rotation_method_value
        {
            /// <summary>
            /// <para>Geographic</para>
            /// <para>Geographic—The angle is calculated clockwise with 0 at the top. This is the default.</para>
            /// <para>地理 - 角度按顺时针方向计算，顶部为 0。这是默认设置。</para>
            /// </summary>
            [Description("Geographic")]
            [GPEnumValue("GEOGRAPHIC")]
            _GEOGRAPHIC,

            /// <summary>
            /// <para>Arithmetic</para>
            /// <para>Arithmetic—The angle is calculated counterclockwise with 0 at the right.</para>
            /// <para>算术 - 角度按逆时针方向计算，右侧为 0。</para>
            /// </summary>
            [Description("Arithmetic")]
            [GPEnumValue("ARITHMETIC")]
            _ARITHMETIC,

            /// <summary>
            /// <para>Graphic</para>
            /// <para>Graphic—The angle is calculated counterclockwise with 0 at the top.</para>
            /// <para>图形 - 角度按逆时针方向计算，顶部为 0。</para>
            /// </summary>
            [Description("Graphic")]
            [GPEnumValue("GRAPHIC")]
            _GRAPHIC,

        }

        /// <summary>
        /// <para>Coordinate System Field</para>
        /// <para>The field containing a projection engine string for a projected coordinate system to be used for angle calculation. The angle calculation for each feature will be based on the projected coordinate system projection engine string for the specific feature. In cases of an invalid value, the tool will use the cartographic coordinate system specified in the Cartography environment settings. The default is none, or no field specified. When no field is specified, the projected coordinate system used for calculation will be taken from the Cartography environment settings.</para>
        /// <para>包含用于角度计算的投影坐标系的投影引擎字符串的字段。每个要素的角度计算将基于特定要素的投影坐标系投影引擎字符串。如果值无效，该工具将使用制图环境设置中指定的制图坐标系。默认值为 none，或未指定字段。如果未指定字段，则用于计算的投影坐标系将从制图环境设置中获取。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Coordinate System Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _coordinate_sys_field { get; set; } = null;


        /// <summary>
        /// <para>Output Features</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Features")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_features { get; set; }


        public CalculateGridConvergenceAngle SetEnv(object cartographicCoordinateSystem = null, object workspace = null)
        {
            base.SetEnv(cartographicCoordinateSystem: cartographicCoordinateSystem, workspace: workspace);
            return this;
        }

    }

}